package com.qing.deep_in.springboot.chapter4.aspect.service.impl;

import com.qing.deep_in.springboot.chapter4.aspect.bean.User;
import com.qing.deep_in.springboot.chapter4.aspect.service.UserService;
import org.springframework.stereotype.Service;

/**
 * @author guoqf
 * @date 2021/9/11 21:43
 */
@Service
public class UserServiceImpl implements UserService {

    private int times = 0;
    @Override
    public void addUser(User user) {
        System.out.println("==========addUser: "+user);
        times++;
        if ((times & 1) == 0) {
            throw new RuntimeException("error: times is = " + times);
        }
    }
}
